package com.xx.service;

import com.xx.entity.People;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PeopleServie {

    @Resource
    private MongoTemplate mongoTemplate;

    public List<People> getAll() {
        return mongoTemplate.findAll(People.class);
    }

    public void batchSave(People people){
        mongoTemplate.save(people);
    }
}
